import axios from '../utils/http'

export const  checkLogin =(data)=>{
    return axios.post('/users/checkLogin',data)
}
// 获取用户信息
export const  getAccountinfo =(data)=>{
    return axios.get('/users/accountinfo',{params:data})
}

export const getUserList = (data) => {
    return axios.get('/users/list', {
        params: data
    });
}
export const editUser = (data) => {
    return axios.post('/users/edit', data)
}
export const deleteUser = (id) => {
    return axios.get('/users/del', {
        params: id
    });
}




export const addUser = (data) => {
    return axios.post('/users/add', data)
}
export const changePassword = (data) => {
    return axios.post('/users/editpwd', data)
}
// export const uploagavatar = (formData) => {
//     return axios.post('/users/avatar_upload', formData)
// }
export const uploagavatar =  (data,params) => {
    return axios.post('/users/avatar_upload', data,{params})
}

export const editavater = (formData) => {
    return axios.post('/users/avataredit', formData)
}

export const getstategoods = () => {
    return axios.get('/stats/goods')
}
export const getstateorder = () => {
    return axios.get('/stats/order')
}
export const homepagestate = () => {
    return axios.get('/stats/total')
}